home *** CD-ROM | disk | FTP | other *** search
/ SGI Desktop Special Edition 1.1 / SGI Desktop Special Edition 1.1.iso / dist / SoftWindows2.idb / usr / lib / SoftWindows2 / bin / scripts / newexec.pl.z / newexec.pl
Encoding:
Perl Script  |  1995-11-13  |  1.4 KB  |  48 lines

  1. #!/usr/sbin/perl
  2. $SWIN2HOME=$ENV{'SWIN2HOME'};
  3. open(AUTOEXEC,"<$SWIN2HOME/tmp/autoexec.bat");
  4. @bat=<AUTOEXEC>;
  5. close AUTOEXEC;
  6. open(AUTOEXEC,">$SWIN2HOME/tmp/autoexec.bat");
  7.  
  8. seek(AUTOEXEC,0,0);
  9.  
  10. foreach (@bat) {
  11.  
  12.     if (/Net Use G: \$SWINHOME\/windows
  13. /) {next;}
  14.     if (/Net Use H: \$HOME
  15. /) {next;}
  16.     if (/Net Use F: \/CDROM
  17. /) {next;}
  18.     if (/Net Use K: \/floppy
  19. /) {next;}
  20.  
  21.     if (/rem Do not Delete any of the code between this remark and the end of this
  22. /) {$IN_BLOCK=1;next;}
  23.  
  24.     if ($IN_BLOCK) {
  25.         if (m#rem block\.
  26. #o) {next;}
  27.         if (m#rem
  28. #o) {next;}
  29.         if (m#net use j: \$SWINHOME
  30. #o) {next;}
  31.         if (m#if exist j:\\12\d+\.\* goto out 
  32. #o) {next;}
  33.         if (m#c:\\insignia\\runux/q j:\\bin\\scripts\\upquest\.sh
  34. #o) {next;}
  35.         if (m#if errorlevel 2 goto warn
  36. #o) {next;}
  37.         if (m#if errorlevel 1 goto upd
  38. #o) {next;}
  39.         if (m#:warn
  40. #o) {next;}
  41.         if (m#c:\\insignia\\runux/q j:\\bin\\scripts\\nupwarn\.sh
  42. #o) {next;}
  43.         if (m#if errorlevel 2 goto upd
  44. #o) {next;}
  45.         if (m#if errorlevel 1 goto out
  46. #o) {next;}
  47.         if (m#:upd
  48. #o) {next;}
  49.         if (m#if exist g:\\sgupdate\.bat g:\\sgupdate\.bat
  50. #o) {next;}
  51.         if (m#c:\\insignia\\runux/q j:\\bin\\scripts\\baddist\.sh
  52. #o) {next;}
  53.         if (m#goto end
  54. #o) {next;}
  55.         if (m#:out
  56. #o) {next;}
  57.         if (m#net use j: /D
  58. #o) {next;}
  59.         if (m#:end
  60. #o) {next;}
  61.         if (m#rem
  62. #o) {next;}
  63.         if (m#rem End of Block
  64. #o) {$IN_BLOCK=0;next;}
  65.     }
  66.  
  67.     print AUTOEXEC;
  68. }
  69.  
  70. print AUTOEXEC <<ADDENDUM;
  71. IF EXIST G:\SWDOCK.BAT CALL G:\SWDOCK.BAT
  72. ADDENDUM
  73.